<?php
namespace admin\action;

use herosphp\http\HttpRequest;
use herosphp\utils\AjaxResult;
use herosphp\bean\Beans;

/**--tmpl-use--**/

class CartAction extends CommonAction {

	public function C_start()
	{
		parent::C_start();	
		/**--tmpl-starttodo--**/
	}

	/**--tmpl-vars--**/

	protected $serviceBean="trading.tradingCart.service";


	/**--tmpl-construct--**/

	/**--tmpl-method--**/

	/**-- actionAdd --**/
	public function add(HttpRequest $request) {
	
		parent::add($request);
	
		/**--tmpl-addtodo--**/
	
		$this->assign("title", "购物车表列表");
		$this->assign('bread', array('会员中心','购物车表管理',$this->getTemplateVar('title')));
		$this->assign('breadUrl', array(url('admin'), url('admin/trading_cart/index'),'javascript:;'));
	
	}
	
	/**-- actionEdit --**/
	public function edit(HttpRequest $request) {
	
		/**--tmpl-editbefore--**/
		parent::edit($request);
		/**--tmpl-editafter--**/
	
		$this->assign("title", "购物车表列表");
		$this->assign('bread', array('会员中心','购物车表管理',$this->getTemplateVar('title')));
		$this->assign('breadUrl', array(url('admin'), url('admin/trading_cart/index'),'javascript:;'));
	}
	
	/**-- actionIndex --**/
	public function index(HttpRequest $request) {
		/**--tmpl-indexbefore--**/
	
		$conditions = array();
		$this->assign('_table','购物车表');
		$s_member_id = $request->getParameter('s_member_id');
		$this->assign('s_member_id',$s_member_id);
		if($s_member_id !== '' && $s_member_id!== NULL)$conditions['member_id'] = '%'.$s_member_id.'%';
		$this->assign('_filter',array('member_id'));
		$this->assign('_header',array(''));
		$this->setConditions($conditions);
	
		$pagesize = $request->getParameter('pagesize') ? $request->getParameter('pagesize') : $this->getPagesize();
		$order = $request->getParameter('order') ? $request->getParameter('order') : $this->getOrder();
		$order = str_replace('+' , " ",$order);
		$this->setPagesize($pagesize);
		$this->setOrder($order);
		$this->assign('order',$order);
		$this->assign('pagesize',$pagesize);
		parent::index($request);
	
		/**--tmpl-indexafter--**/
	
		$this->assign("title", "购物车表列表");
		$this->assign('bread', array('会员中心','购物车表管理',$this->getTemplateVar('title')));
		$this->assign('breadUrl', array(url('admin'), url('admin/trading_cart/index'),'javascript:;'));
	}
	
	/**-- doAddMethod --**/
	public function do_add(HttpRequest $request)
	{
		$data = $request->getParameter('data');
	
		/**--tmpl-todo--**/
		$request->addParameter('data',$data);
		parent::do_add($request);	
	}
	
	/**-- doEditMethod --**/
	public function do_edit(HttpRequest $request){
		$data = $request->getParameter('data');
	
		/**--tmpl-todo--**/
		$request->addParameter('data',$data);
		parent::do_edit($request);	
	}
	
	

}
